<template>
        <input type="checkbox" v-model="isAll"/>
</template>

<script>
export default {
  props: ['arr'],
  computed: {
    isAll: {
      get () {
        if (this.arr.length === 0) return false
        return (this.arr.every(item => (item.checked === true)))
      },
      set (val) {
        this.arr.forEach(item => (item.checked = val))
      }
    }
  }
}
</script>

<style>

</style>
